package com.situ.domain.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@Builder
@TableName("t_order")
@Schema(description = "订单表")
@AllArgsConstructor
@NoArgsConstructor
public class TOrder {
    @TableId
    @Schema(description = "订单编号")
    private String oid;

    @Schema(description = "用户编号")
    private Integer uid;

    @Schema(description = "收货人")
    private String recvName;

    @Schema(description = "收货人电话")
    private String recvPhone;

    @Schema(description = "收货省份")
    private String recvProvince;

    @Schema(description = "收货城市")
    private String recvCity;

    @Schema(description = "收货区域")
    private String recvArea;

    @Schema(description = "收货详细地址")
    private String recvAddress;

    @Schema(description = "订单总价")
    private Double totalPrice;

    @Schema(description = "订单状态:0-未支付，1-已支付，2-已取消，3-已关闭，4-已完成")
    private Integer status;

    @Schema(description = "下单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime orderTime;

    @Schema(description = "支付时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime payTime;

    @Schema(description = "创建者")
    private String createdUser;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdTime;

    @Schema(description = "修改者")
    private String modifiedUser;

    @Schema(description = "修改时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime modifiedTime;

    @Schema(description = "货物状态：-1-退货退款 0-未支付,1-未发货，2-已发货 3-已完成 4-已评价")
    private Integer state;

}